{% extends "home/base.html" %}
{% block title %}-意见反馈{% endblock %}
{% block help %}current-item{% endblock %}
{% block mainbody %}
    <div class="main">
        <form class="text-align-center" id="form" method="post" action="/help">
            <textarea class="descript" name="descript" rows="15" cols="100" maxlength="1000" placeholder="提出您的意见和建议，以帮助改善系统（最多可写1000字）"></textarea>
            <div id="error" class="error">{{ error }}</div>
            <div class="submit-div">
                <span id="submit-btn" class="submit-btn" onclick="submitForm()">提交</span>
                <script>
                    function submitForm() {
                        if (document.getElementsByClassName("descript").length > 0) {
                            if (document.getElementsByClassName("descript")[0].value == "") {
                                document.getElementById("error").innerHTML = "请填写信息"
                            } else {
                                document.getElementById("form").submit()
                            }
                        }
                    }
                </script>
            </div>
        </form>
    </div>
{% endblock %}
